package cqrtplm.service.impl;

import cqrtplm.mapper.DocRevisionMapper;
import cqrtplm.service.DocRevisionService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;

@Service
public class DocRevisionServiceImpl implements DocRevisionService {

    @Resource
    private DocRevisionMapper docRevisionMapper;

    @Override
    public void modifyTheDocHistoryStatusToInvalid(String docId) {
        String masteredId = docRevisionMapper.selectDocMasteredOidByOid(docId);

        String oid=docRevisionMapper.selectNewDocOid(masteredId);

        docRevisionMapper.updateDocLifecyclestagekey(masteredId,oid);
    }

    @Override
    public void modifyTheCadDocHistoryStatusToInvalid(String id) {
        String masteredId = docRevisionMapper.selectCadDocMasteredOidByOid(id);

        String oid=docRevisionMapper.selectNewCadDocOid(masteredId);

        docRevisionMapper.updateCadDocLifecyclestagekey(masteredId,oid);
    }
}
